package storage

import (
	"codeless/config"
	models "codeless/model"
	"mime/multipart"
)

type Storage interface {
	Upload(fh *multipart.FileHeader) (*models.RestOss, error)
	UploadPath(path string) (*models.RestOss, error)
	Delete(name string) error
}

func GetStorage() Storage {
	name := config.GetAppConfig().Fs.Storage
	if name == "local" {
		return &LocalStorage{}
	} else {
		return &CosStorage{}
	}
}
